<template>
	<view>
		<view class="title">实名认证</view>
		<view class="summary">为保障您的资金安全和有效权益，请填写与您身份证一致的信息，否则不会通过审核。</view>
		<view class="formbox">
			<view class="formbox-item">
				<view class="formbox-item-title">真实姓名</view>
				<view class="formbox-item-input">
					<input v-model="username" placeholder="请填写您本人的真实姓名"  placeholder-class="placeholderClass"/>
				</view>
			</view>
			<view class="formbox-item">
				<view class="formbox-item-title">身份证号</view>
				<view class="formbox-item-input">
					<input v-model="idcard" placeholder="请填写您本人的身份证号"  placeholder-class="placeholderClass"/>
				</view>
			</view>
		</view>
		<view class="fiexd-btn">
			<button @click="verify()">提交认证</button>
		</view>
	</view>
</template>

<script>
	
	export default {
		data() {
			return {
				username:'',
				idcard:''
			}
		},
		onLoad(){
			
		},
		
		onShow(){
		
		},
		methods: {
			pageTo(url){
				this.$util.$navigateTo(url);
			},
			
			verify(){
				let param = {
					
					username:this.username,
					idcard:this.idcard
				}
				if(this.username == '' || this.idcard == ''){
					this.$util.$showToast('请填写资料', '', 'none');
					return;
				}
				
				let that = this;
				this.$api.doVerify(param).then(res => {
					
					if(res.code == 1){
						uni.redirectTo({
							url:'./realnameResult'
						})
					}else{
						that.$util.$showToast(res.msg, '', 'none');
						
					}
					console.info(res)
				})
			}
		}
	}
</script>

<style lang="scss">
	.title{
		font-size: 48rpx;
		color: #333333;
		margin: 66rpx 40rpx 30rpx 40rpx;
	}
	.summary{
		margin-left: 40rpx;
	}
	.formbox{
		margin-top: 80rpx;
		.formbox-item{
			padding: 40rpx 0;
			margin: 0 40rpx;
			border-bottom: 1rpx solid #EBEBEB;
			.formbox-item-title{
				font-size: 28rpx;
				color: #333333;
				margin-bottom: 40rpx;
			}
			.formbox-item-input{
				font-size: 28rpx;
				color:#666666;
			}
		}
	}
	.fiexd-btn{
		position: fixed;
		bottom: 30rpx;
		left: 40rpx;
		width: 670rpx;
		button{
			color: #FFFFFF;
			background: $uni-color-primary;
		}
	}
</style>
